<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title> - 亲友圈列表</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<!--<link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/css/new_file.css" rel="stylesheet">-->
	<link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/css/new_file.css" rel="stylesheet">
	<link href="__STATIC__/css/tool.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h5>亲友圈列表</h5>
				</div>
				<div class="toogl_body">
					<div class="toogl_tale">
						<a href="dataclub"><input type="button" value="亲友圈列表" class="btn btn-w-m btn-info"></a>
						<a href="dataclub_2"><input type="button" value="蓝钻耗钻统计" class="btn btn-w-m btn-default"></a>
						<!--<a href="dataclub_3"><input type="button" value="钻石消耗子表" class="btn btn-w-m btn-default"></a>-->
						<a href="dataclub_4"><input type="button" value="会员卡销售" class="btn btn-w-m btn-default"></a>
						<a href="dataclub_5"><input type="button" value="黄钻统计" class="btn btn-w-m btn-default"></a>
					</div><br/>
					<div class="ibox-content ibox-jqGrid">
                    	<p>
                    		选择时间段：<input type="text" id="time" class="input-ys" readonly="readonly">
                    		亲友圈ID：<input type="text" id="cid" class="input-ys" >
							亲友圈名称：<input type="text" id="club_name" class="input-ys" >
                    		会长ID：<input type="text" id="president_id" class="input-ys" >
							商业模式：<select  id="club_type" cclass="col-sm-8 form-time1 select_ys"> >
										<option value="">请选择商业模式</option>
										<option value="0">分成模式</option>
										<option value="1">免费模式</option>
									</select>　
                    		<input type="button" id="buttonid" value="查询" class="input-anniu">
                    	</p>
						<div class="jqGrid_wrapper">
							<table id="table_list_1"></table>
							<div id="pager_list_1"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="myModal7" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<div class="gam_bg">
									<div class="gam_bgnrt3">
										<span>会员卡名称</span>
									</div>
									<!--<div class="gam_bgnrt">-->
										<!--<span>会员卡ID</span>-->
									<!--</div>-->
									<div class="gam_bgnrt3">
										<span>会员卡数量</span>
									</div>
								</div>
								<div id="affiliated_club">
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m btn-info" type="button" value="确定">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!--手机导航-->
<div class="to-fdh" style="display: none;">
	<img class="to-imgd" src="__STATIC__/img/phonedh.jpg">
	<div class="mob-nrlb">
		<ul>
			<li>
				<a class="mob-nrdh">管理</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('Player/gameplayer')}">玩家管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('system/notice')}">公告管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('email/mail')}">邮件管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Club/club')}">亲友圈管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Money/money')}">提现管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Order/order')}">订单管理</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh">数据</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('data/datagk')}">概況</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datawf')}">玩法</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datalc')}">留存</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datass')}">实时数据</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataczfx')}">充值分析</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataclub')}">亲友圈统计</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/president')}">高级会长</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/regionaldata')}">地区数据</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh mob-qbh">权限</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_list')}">权限管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_group')}">用户组管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('account/account_details')}">后台账号管理</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
</div>
<div id="zkbg">
	<img src="__STATIC__/img/dp.gif">
</div>
<div class="vnl-zz" style="display:none">
	<div><img src="__STATIC__/img/bqhp.gif"></div>
</div>
<!--手机适配-->
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
<script src="__STATIC__/js/content.js?v=1.0.0"></script>
<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
<script src="__STATIC__/js/echarts.min.js"></script>
<script src="__STATIC__/js/echarts.common.min.js"></script>
<script>
    //手机适配
    $(function(){
        if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
            $("head").append("<link>");
            var css = $("head").children(":last");
            css.attr({
                rel:  "stylesheet",
                type: "text/css",
                href: "__STATIC__/css/phone_sp.css"
            });
            var mql = window.matchMedia("(orientation: portrait)");
            if(mql.matches) { //竖屏样式
                $(".vnl-zz").show();
                $(".to-fdh").hide();
            }else{
                $(".to-fdh").show();
                $("html").width("100%");
                $("body").width("100%");
            }
            mql.addListener(function(m) {
                if(m.matches) {
                    // 改变到直立方向
                    $(".vnl-zz").show();
                    $(".to-fdh").hide();
                }
                else {
                    $(".to-fdh").show();
                    $(".vnl-zz").hide();
                    $("html").width("100%");
                    $("body").width("100%");
                }
            });
        }
    });
    //导航显示展开
    $(".mob-nrdh").click(function(){
        $(this).next().toggle(".mob-nryc");
    });
    $(".to-imgd").click(function(){
        $(this).next().toggle(".mob-nrlb");
    });
    //手机适配end
    $('#buttonid').on('click', function() {
        var time = $("#time").val();
        var cid = $("#cid").val();
        var club_name = $("#club_name").val();
        var president_id = $("#president_id").val();
        var club_type =  $("#club_type").val();
        $("#table_list_1").jqGrid('setGridParam',{
            url:'__URL__/club_list',
            datatype:'json',
            postData:{'time':time,'cid':cid,'club_name':club_name,'president_id':president_id,'club_type':club_type}, //发送数据
            page:1
        }).trigger("reloadGrid"); //重新载入
    });
    //所属亲友圈 详情
    function affiliated_club(t){
        $("#affiliated_club").html("");
        var club_id= $(t).parent().parent().children().eq(0).html();
        var player_id= $(t).parent().parent().children().eq(3).html();
        $.ajax({
            type: "post",
            url: "__URL__/vip_details",
            data: {
                'club_id':club_id,
                'player_id':player_id,
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                for(i in e){
                // <div class="gam_bgnrt2"><span>'+e[i].vid+'</span></div>
                    $("#affiliated_club").append('<div class="gam_bg"><div class="gam_bgnrt4"><span>'+e[i].vip_name+'</span></div><div class="gam_bgnrt4"><span>'+e[i].number+'</span></div></div>');
                }
            },
            error: function(e) {
                console.log(e);
                // var json = eval("("+e+")");
            }
        });
    }
  $(document).ready(function () {

            $.jgrid.defaults.styleUI = 'Bootstrap';
            // Examle data for jqGrid
            // Configuration for jqGrid Example 1
            $("#table_list_1").jqGrid({
                // url:'__URL__/club_list',
                postData:{},
                datatype: "json",
                mtype: 'POST',
                height: 500,
                autowidth: true,
                shrinkToFit: true,
                rowNum: 20,
                rowList: [20,50,100],
                colNames: ['亲友圈ID', '亲友圈名称', '创建时间', '会长ID', '会长昵称', '成员数/上限', '会员卡情况', '黄钻库存','亲友圈模式','耗充值钻总数'],
                colModel: [
                    {
                        name: 'cid',
                        index: 'cid',
                        width: 60,
                        sorttype: "int",
                        align:"center"
                    },
                    {
                        name: 'club_name',
                        index: 'club_name',
                        width: 90,
                        align:"center"
                    },
                    {
                        name: 'create_time',
                        index: 'create_time',
                        width: 100,
                        align:"center"
                    },
                    {
                        name: 'president_id',
                        index: 'president_id',
                        width: 80,
                        sorttype: "float",
                        align:"center"
                    },
                    {
                        name: 'president_name',
                        index: 'president_name',
                        width: 80,
                        sorttype: "float",
                        align:"center"
                    },
                    {
                        name: 'number_people',
                        index: 'number_people',
                        width: 90,
                        sorttype: "date",
                        align:"center"
                    },
                    {
                        name: 'vip_card',
                        index: 'vip_card',
                        width: 100,
                        formatter: function(vip_card) {
                            return '<input type="button" value="详情" data-toggle="modal" data-target="#myModal7" class="btn btn-info" onclick="affiliated_club(this)"/>';
                        },
                        align:"center"
                    },
                    {
                        name: 'diamond',
                        index: 'diamond',
                        width: 80,
                        sorttype: "float",
                        align:"center"
                    },
                    {
                        name: 'club_type',
                        index: 'club_type',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center',
                        formatter: function(club_type) {
                            switch(Number(club_type)){
                                case 0:
                                    return '<span style="color:red">分成模式</span>'
                                case 1:
                                    return '<span style="color:#00EE00">免费模式</span>'
                            }
                        },
                    },
                    {
                        name: 'sum',
                        index: 'sum',
                        width: 80,
                        sorttype: "float",
                        align:"center"
                    },

                ],
                pager: "#pager_list_1",
                viewrecords: true,
                loadonce: true,
                caption: "亲友圈列表",
                hidegrid: false
            });
            // Add responsive to jqGrid

        
		setTimeout(function(){
            var width = $('.jqGrid_wrapper').width();
            $('#table_list_1').setGridWidth(width);
		},500);
        
        
        });
  
	laydate.render({
	  elem: '#time',
	  range: true
	});
</script>
</body>

</html>